package com.hmy.common.exception;


public class CustomException extends RuntimeException {
    private int errorCode;

    public CustomException(String message) {
        super(message);
        this.errorCode = -1;
    }

    public CustomException(String message, int errorCode) {
        super(message);
        this.errorCode = errorCode;
    }

    public CustomException(ResultEnum ResultEnum) {
        this(ResultEnum.getMsg(), ResultEnum.getCode());
    }

    public CustomException(IResultEnum t) {
        this(t.getMsg(), t.getCode());
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }
}
